package com.hbfu.zggdwlzzsx.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hbfu.zggdwlzzsx.entity.Users;
import com.hbfu.zggdwlzzsx.mapper.UsersMapper;
import com.hbfu.zggdwlzzsx.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {

    @Autowired
    private UsersMapper UsersMapper;

    @Override
    public Users validateUser(String account, String password) {
        QueryWrapper<Users> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("account", account)
                    .eq("password", password);
        return this.getOne(queryWrapper);
    }

}